<?php
declare (strict_types=1);

use think\facade\Route;

//登录
Route::group('login', function () {
    Route::get('/index', 'login/index');
    Route::post('/check', 'login/check');
    Route::post('/logout', 'login/logout');
});

//上传
Route::group('uploads', function () {
    Route::rule('/uploadImage', 'uploads/uploadImage');
    Route::rule('/uploadVideo', 'uploads/uploadVideo');
    Route::rule('/uploadEditorVideo', 'uploads/uploadEditorVideo');
    Route::rule('/uploadFile', 'uploads/uploadFile');
});

//素材库
Route::group('gallery', function () {
    Route::get('/index', 'gallery/index');
    Route::get('/open', 'gallery/open');
    Route::post('/upload', 'gallery/upload');
    Route::post('/addOperate', 'gallery/addOperate');
    Route::get('/getQnToken', 'gallery/getQnToken');
    Route::post('/destroy', 'gallery/destroy');
    Route::post('/addGroup', 'gallery/addGroup');
    Route::post('/saveGroup', 'gallery/saveGroup');
    Route::post('/destroyGroup', 'gallery/destroyGroup');
});

//首页
Route::get('/', 'index/index')->middleware('verify');
Route::group('index', function () {
    Route::get('/index', 'index/index');
    Route::get('/welcome', 'index/welcome');
    Route::get('/clear_cache', 'index/clear_cache');
})->middleware('verify');

//我的桌面
Route::group('desktop', function () {
    Route::get('/index', 'desktop/statistics');
})->middleware('verify');

//会员管理
Route::group('user', function () {
    Route::get('/ordinary', 'user/ordinary');
    Route::get('/formal', 'user/formal');
    Route::get('/getList', 'user/getList');
    Route::get('/export', 'user/export');
    Route::get('/add', 'user/add');
    Route::get('/edit', 'user/edit');
    Route::post('/save', 'user/save');
    Route::post('/update', 'user/update');
    Route::post('/delete', 'user/delete');
    Route::post('/reset', 'user/reset');
    Route::rule('/login', 'user/login');
    Route::rule('/recharge', 'user/recharge','POST|GET');
})->middleware('verify');

//推荐关系
Route::group('relation', function () {
    Route::get('/index', 'relation/index');
    Route::get('/getData', 'relation/getData');
})->middleware('verify');

//账户管理
Route::group('account', function () {
    Route::get('/index', 'account/index');
    Route::get('/getList', 'account/getList');
    Route::get('/export', 'account/export');
    Route::get('/add', 'account/add');
    Route::get('/edit', 'account/edit');
    Route::get('/recharge', 'account/recharge');
    Route::get('/bonus', 'account/bonus');
})->middleware('verify');

//充值管理
Route::group('remit', function () {
    Route::get('/index', 'remit/index');
    Route::get('/getList', 'remit/getList');
    Route::get('/export', 'remit/export');
    Route::get('/edit', 'remit/edit');
    Route::post('/save', 'remit/save');
    Route::post('/batchPass', 'remit/batchPass');
    Route::post('/batchReject', 'remit/batchReject');
})->middleware('verify');

//提现管理
Route::group('draw', function () {
    Route::get('/index', 'draw/index');
    Route::get('/getList', 'draw/getList');
    Route::get('/export', 'draw/export');
    Route::get('/edit', 'draw/edit');
    Route::post('/save', 'draw/save');
    Route::post('/batchPass', 'draw/batchPass');
    Route::post('/batchReject', 'draw/batchReject');
})->middleware('verify');

//转账管理
Route::group('transfer', function () {
    Route::get('/index', 'transfer/index');
    Route::get('/getList', 'transfer/getList');
    Route::get('/export', 'transfer/export');
})->middleware('verify');

//转换管理
Route::group('exchange', function () {
    Route::get('/index', 'exchange/index');
    Route::get('/getList', 'exchange/getList');
    Route::get('/export', 'exchange/export');
})->middleware('verify');

//奖金总表-按会员统计
Route::group('summaryUser', function () {
    Route::get('/index', 'summaryUser/index');
    Route::get('/getList', 'summaryUser/getList');
    Route::get('/export', 'summaryUser/export');
    Route::get('/summary_info', 'summaryUser/summary_info');
})->middleware('verify');

//奖金总表-按日期统计
Route::group('summaryDate', function () {
    Route::get('/index', 'summaryDate/index');
    Route::get('/getList', 'summaryDate/getList');
    Route::get('/export', 'summaryDate/export');
    Route::get('/summary_info', 'summaryDate/summary_info');
})->middleware('verify');

//新闻公告
Route::group('news', function () {
    Route::get('/index', 'news/index');
    Route::get('/getList', 'news/getList');
    Route::get('/add', 'news/add');
    Route::get('/edit', 'news/edit');
    Route::post('/save', 'news/save');
    Route::post('/update', 'news/update');
    Route::post('/delete', 'news/delete');
})->middleware('verify');

//轮播管理
Route::group('carousel', function () {
    Route::get('/index', 'carousel/index');
    Route::get('/getList', 'carousel/getList');
    Route::get('/add', 'carousel/add');
    Route::get('/edit', 'carousel/edit');
    Route::post('/save', 'carousel/save');
    Route::post('/update', 'carousel/update');
    Route::post('/delete', 'carousel/delete');
})->middleware('verify');

//留言管理
Route::group('message', function () {
    Route::get('/index', 'message/index');
    Route::get('/getList', 'message/getList');
    Route::get('/add', 'message/add');
    Route::get('/edit', 'message/edit');
    Route::post('/save', 'message/save');
})->middleware('verify');

//消息管理
Route::group('notice', function () {
    Route::get('/group', 'notice/group');
    Route::get('/getData', 'notice/getData');
    Route::get('/show_order', 'notice/show_order');
    Route::get('/show_user', 'notice/show_user');
    Route::get('/show_message', 'notice/show_message');
    Route::get('/all_read', 'notice/all_read');
    Route::get('/noticeCount', 'notice/noticeCount');
})->middleware('verify');

//商品分类
Route::group('productCate', function () {
    Route::get('/index', 'productCate/index');
    Route::get('/add', 'productCate/add');
    Route::get('/edit', 'productCate/edit');
    Route::post('/save', 'productCate/save');
    Route::rule('/update', 'productCate/update');
    Route::get('/getCate', 'productCate/getCate');
})->middleware('verify');

//商品列表
Route::group('product', function () {
    Route::get('/index', 'product/index');
    Route::get('/getList', 'product/getList');
    Route::get('/add', 'product/add');
    Route::get('/edit', 'product/edit');
    Route::post('/save', 'product/save');
    Route::post('/update', 'product/update');
    Route::post('/delete', 'product/delete');
})->middleware('verify');

//订单管理
Route::group('order', function () {
    Route::get('/index', 'order/index');
    Route::get('/getList', 'order/getList');
    Route::get('/export', 'order/export');
    Route::get('/edit', 'order/edit');
    Route::post('/update', 'order/update');
    Route::post('/delete', 'order/delete');
    Route::get('/getArea', 'order/getArea');
    Route::rule('/deliver', 'order/deliver');
    Route::rule('/singleExport', 'order/singleExport');
})->middleware('verify');

//菜单管理
Route::group('menu', function () {
    Route::get('/index', 'menu/index');
    Route::get('/getList', 'menu/getList');
    Route::get('/add', 'menu/add');
    Route::get('/edit', 'menu/edit');
    Route::post('/save1', 'menu/save1');
    Route::get('/updateStatus', 'menu/updateStatus');
    Route::post('/delete', 'menu/delete');
})->middleware('verify');

//银行管理
Route::group('bank', function () {
    Route::get('/index', 'bank/index');
    Route::get('/getList', 'bank/getList');
    Route::get('/add', 'bank/add');
    Route::get('/edit', 'bank/edit');
    Route::post('/save', 'bank/save');
    Route::post('/update', 'bank/update');
    Route::post('/delete', 'bank/delete');
})->middleware('verify');

//物流管理
Route::group('express', function () {
    Route::get('/index', 'express/index');
    Route::get('/getList', 'express/getList');
    Route::get('/add', 'express/add');
    Route::get('/edit', 'express/edit');
    Route::post('/save', 'express/save');
    Route::post('/update', 'express/update');
    Route::post('/delete', 'express/delete');
    Route::get('/list', 'express/list');
})->middleware('verify');

//网站配置
Route::group('config', function () {
    Route::get('/index', 'config/index');
    Route::get('/getList', 'config/getList');
    Route::get('/add', 'config/add');
    Route::get('/edit', 'config/edit');
    Route::post('/save', 'config/save');
    Route::post('/update', 'config/update');
    Route::post('/delete', 'config/delete');
    Route::get('/create', 'config/create');
    Route::post('/saveGroup', 'config/saveGroup');
})->middleware('verify');

//角色管理
Route::group('role', function () {
    Route::get('/index', 'role/index');
    Route::get('/getList', 'role/getList');
    Route::get('/add', 'role/add');
    Route::get('/edit', 'role/edit');
    Route::post('/save', 'role/save');
    Route::post('/update', 'role/update');
    Route::post('/delete', 'role/delete');
    Route::rule('/give', 'role/give');
})->middleware('verify');

//用户列表
Route::group('admin', function () {
    Route::get('/index', 'admin/index');
    Route::get('/getList', 'admin/getList');
    Route::get('/add', 'admin/add');
    Route::get('/edit', 'admin/edit');
    Route::post('/save', 'admin/save');
    Route::post('/update', 'admin/update');
    Route::post('/delete', 'admin/delete');
    Route::rule('/password', 'admin/password');
})->middleware('verify');

//数据管理
Route::group('backup', function () {
    Route::get('/index', 'backup/index');
    Route::get('/add', 'backup/add');
    Route::get('/import', 'backup/import');
    Route::get('/clear', 'backup/clear');
    Route::get('/backup', 'backup/delete');
})->middleware('verify');

//操作日志
Route::group('logs', function () {
    Route::get('/index', 'logs/index');
    Route::get('/getList', 'logs/getList');
    Route::get('/queryIp', 'logs/queryIp');
})->middleware('verify');

//定时测试
Route::group('test', function () {
    Route::get('/index', 'test/index');
    Route::post('/execute', 'test/execute');
})->middleware('verify');

//会员等级
Route::group('userLevel', function () {
    Route::get('/index', 'userLevel/index');
    Route::get('/getList', 'userLevel/getList');
    Route::get('/edit', 'userLevel/edit');
    Route::post('/save', 'userLevel/save');
})->middleware('verify');
